package cn.kgc.spring03.controller;

import cn.kgc.spring03.service.UserService;
import cn.kgc.spring03.service.impl.UserServiceImpl2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

/**
 * @Author: 课工场
 * @Version: v1.0  2023/2/19
 * @Description:  servlet
 */
@Controller
public class UserController {

    @Autowired(required = false)  //  required 默认是true  属性初始化失败会抛出异常
    private UserService userService;

    public void getUserService(){
        System.out.println("userService = " + userService);
    }

}
